<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'da.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="content-type" content="text/html;charset=utf-8">

<link rel="stylesheet" href="js/easyui/demo/demo.css" type="text/css"></link>
<link rel="stylesheet" href="js/easyui/themes/icon.css" type="text/css"></link>
<link rel="stylesheet" href="js/easyui/themes/default/easyui.css"
	type="text/css"></link>
<script type="text/javascript" src="js/easyui/jquery-1.6.min.js"></script>
<script type="text/javascript" src="js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="script/common.js"></script>
<script type="text/javascript" src="js/easyui/themes/easyui-lang-zh_CN.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">

</style>
<script type="text/javascript">

	/**
	 * 根据条件查询
	 */
	function query() {
	
		var code = $("#codeId").val();
		var name = $("#nameId").val();
		var stdPrice = $("#stdPriceId").val();
		
		window.location = 'cracraftShowList?code='+ code+'&name='+ name
					+'&stdPrice='+ stdPrice;
		
	}
	
</script>
</head>
<%
	if (request.getAttribute("allCraftStandardType") == null) {
		if (request.getParameter("offset") != null) {
			response.sendRedirect("stcraftStandardTypeShow.action?offset="
					+ request.getParameter("offset"));
		} else {
			response.sendRedirect("stcraftStandardTypeShow.action");

		}
	}else{
		
	}
 %>
<body>
	<div>
		<h3 class="tab-subtitle">添加工艺${craftName}成功，请选择标准</h3>
	</div>
	<div style="margin:20px 20px 0px 20px; width:85%;">
		<div id="options" class="toolbar">
				<div style="float: left; margin-bottom: 10px;">
					<input class="easyui-textbox" type="text" id="codeId" prompt="工艺编码" value="" data-options="height:26">
					<input class="easyui-textbox" type="text" id="nameId" prompt="工艺价格" value="" data-options="height:26">
				</div>
				<div style=" float: left;">
					<input class="easyui-linkbutton"
						type="button" id="query" style="margin-left: 15px;"
						onclick="query()" value="查询 ">
				</div>
			</div>
		</div>
		
		<div style="width:90%; float: left;" id = "materialShow">
			<table class="easyui-datagrid" style="width=100%;" singleSelect="true">
				<thead>
					<tr>
						<th data-options="field:'code'" width="" align="center">序号</th>
						<th data-options="field:'craftCode'" align="center">编码</th>
						<th data-options="field:'craftName '" align="center">标准名称</th>
						<th data-options="field:'standard'" align="center">描述</th>
						<th data-options="field:'操作'" align="center">选择</th>
					</tr>
				</thead>
				
				<c:choose>
					<c:when test="">
						<tr style="text-align: center;">
							<td colspan="11">
								<span style="color: grey;"></span>
							</td>
						</tr>
					</c:when>
					<c:otherwise>
						<c:forEach items="${allCraftStandardType}" var="craftStandardType" varStatus="i">
							<tr>
								<td>${i.index+1+offset*10 }</td>
								<td>${craftStandardType.craftStdCode}</td>
								<td>${craftStandardType.craftStdName}</td>
								<td>${craftStandardType.description}</td>
								<td>
									<a onclick="" style="text-decoration: underline;">编辑</a><b>|</b>
									<a onclick="" style="text-decoration: underline;">删除</a>
								</td>
							</tr>
						</c:forEach>
					</c:otherwise>
				</c:choose>
			</table>
			<div class="pager" id="pagebar">
				共<b id="ttCount">${totalcount }</b>条记录 转到&nbsp;<input value="${offset+1}" size="2" id="offset" class="easyui-textbox" />&nbsp;页/<b id="ttPage">${totalpage }</b>页
				<button class="easyui-linkbutton jump-btn" width="20" onclick="reload()">跳转</button>
				<a onclick="turnPage(0)">&lt;&lt; 第一页</a> <a
					onclick="turnPage(${offset-1})">&lt; 上一页</a> <a
					onclick="turnPage(${offset+1})">下一页 &gt;</a> <a
					onclick="turnPage(${totalpage-1})">最后一页 &gt;&gt;</a>
			</div>
		</div>
	</div>
</body>
</html>
